<template>
  <div class="brand-detail">
      <div class="banner">
        <img :src="detailInfo.list_pic_url" alt="" />
        <div class="title">
          {{ detailInfo.name }}
        </div>
      </div>
      <div class="desc">
        {{ detailInfo.simple_desc }}
      </div>
      <ul class="list" v-if="goodsList.length">
        <router-link
          tag="li"
          v-for="item in goodsList"
          :key="item.id"
          :to="`/goods/goodsdetail?id=${item.id}`"
        >
          <img :src="item.list_pic_url" alt="" />
          <p class="name">{{ item.name }}</p>
          <p class="price">￥{{ item.retail_price }}</p>
        </router-link>
      </ul>
      <van-empty class="empty_icon" v-else description="暂无数据" />
  </div>
</template>
<script>
import { detailaction } from "@/api/home/brand";
export default {
  data() {
    return {
      detailInfo: {}, // 制造商详情信息
      goodsList: [], // 商品列表
    };
  },
  methods: {
    async init() {
      // 获取详情信息&商品列表
      const { data, goodsList } = await detailaction({
        id: this.$route.query.id,
      });
      this.detailInfo = data;
      this.goodsList = goodsList;
    },
  },
  created() {
    this.init();
  },
};
</script>
<style lang="scss" scoped>
@import "./index.scss";
</style>
